using UnityEngine;
using System.Collections;
using System.IO;

public class MenuEditorHandler : MonoBehaviour {
	
	public static string message = "";
	
	private string fileName = "pwapwa";
	
	void OnGUI(){
		
		GUI.contentColor = Color.black;
		
		//maxValues
		LevelConstants.maxFilter = Mathf.RoundToInt(GUI.VerticalSlider(new Rect(810,5,10,50),LevelConstants.maxFilter, 10.0F, 0.0F));
		LevelConstants.maxMirror = Mathf.RoundToInt(GUI.VerticalSlider(new Rect(875,5,10,50),LevelConstants.maxMirror, 10.0F, 0.0F));
		LevelConstants.maxMixer = Mathf.RoundToInt(GUI.VerticalSlider(new Rect(945,5,10,50),LevelConstants.maxMixer, 10.0F, 0.0F));
		LevelConstants.maxDivider = Mathf.RoundToInt(GUI.VerticalSlider(new Rect(1010,5,10,50),LevelConstants.maxDivider, 10.0F, 0.0F));
		
		GUI.Label(new Rect(770,45,50,30),LevelConstants.nbFilter+"/"+LevelConstants.maxFilter);
		GUI.Label(new Rect(845,45,50,30),LevelConstants.nbMirror+"/"+LevelConstants.maxMirror);
		GUI.Label(new Rect(910,45,50,30),LevelConstants.nbMixer+"/"+LevelConstants.maxMixer);
		GUI.Label(new Rect(975,45,50,30),LevelConstants.nbDivider+"/"+LevelConstants.maxDivider);
		
		//allowColors
		LevelConstants.allowPrimary = GUI.Toggle(new Rect(630,15,120,30),LevelConstants.allowPrimary,"allowPrimary");
		LevelConstants.allowSecondary = GUI.Toggle(new Rect(630,45,120,30),LevelConstants.allowSecondary,"allowSecondary");
		
		
		if (GUI.Button(new Rect(0,50,100,20),"Save")) { 
			LevelHandler.Instance.saveLevel(fileName);
	   }
		
		if (GUI.Button(new Rect(0,30,100,20),"Load")) {
			LevelHandler.Instance.loadLevel(fileName);
	   }
		
		fileName = GUI.TextField(new Rect(0,0,100,20),fileName);
		
		
	}
}
